﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyWork.aspx.cs" Inherits="MyWork"  EnableEventValidation = "false" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>我的业务</title>
    <link href="../Style/MyWork.css" rel="stylesheet" />
    <style>
        /* 侧边栏样式 */
        .menus {
            list-style: none;
            padding: 0;
            margin: 0;
            transition: left 0.5s; /* 动画效果 */
            position: absolute;
            top: 100px;
            left: -200px; /* 默认隐藏 */
            bottom: 0;
            overflow-y: auto;
            float: left;
            width: 200px;
            height: 650px;
            background-color: coral;
            border-radius: 11px;
        }

            .menus li {
                padding: 3px;
            }

            .menus a {
                text-decoration: none;
                display: block;
                padding: 8px 16px;
                color: black;
            }

                .menus a:hover {
                    background-color: #555;
                    color: white;
                }
        /* 图片按钮样式 */
        .menu-toggle {
            cursor: grab;
            float: left;
        }
        /*删除资产按钮位置*/
        .button3 {
            position: absolute;
            top: 12%;
            left: 26%;
        }
        /*导出excel按钮位置*/
        .button4 {
            position: absolute;
            top: 12%;
            left: 40%;
        }

        .product-panel {
            padding: 15px;
        }

        .asset-gridview {
            border-collapse: collapse;
            width: 100%;
            margin-top: 10px;
        }

            .asset-gridview th {
                background-color: #4CAF50;
                color: white;
                text-align: left;
                padding: 10px;
            }

            .asset-gridview td {
                border: 1px solid #ddd;
                padding: 10px;
                text-align: left;
            }

            .asset-gridview tr:nth-child(even) {
                background-color: #f2f2f2;
            }

            .asset-gridview tr:hover {
                background-color: #ddd;
            }

            /* 上一页、下一页图片样式 */
            .asset-gridview a img {
                vertical-align: middle;
            }

        .list {
            text-decoration: none;
        }
        .imagebtn{
           
        }
        .file{
            position:absolute;
            top:15%;
            left:70%;
        }
    </style>
    
</head>
<body>
    <form runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div id="one">
            <%--第一部分--%>
            <div id="logo">
                <img src="../Image/学校.png" alt="Alternate Text" class="menu-toggle" style="margin: 10px; width: 50px; height: 50px; float: left;" />
                <h3 style="margin-top: 22px; font-size: 20px; float: left;">高校资产管理系统</h3>
            </div>
            <div id="daohang" runat="server">
                <%--导航面板--%>
                <ul style="float: right; list-style-type: none; width: 600px;" runat="server">
                    <li style="margin-top:6px;"><a href="../ChangePwd.aspx" class="Topstatus">修改密码</a></li>
                    <li style="margin-top:6px;"><a href="../GetPwd.aspx" class="Topstatus">找回密码</a></li>
                    <li style="margin-top:6px;"><a href="../MyUAMSWeb.aspx" class="Topstatus">退出登录</a></li>
                    <li >
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <asp:ImageButton ID="informationbtn" runat="server" ImageUrl="../Image/消息.png" Width="35px" Height="35px" AlternateText="消息" CssClass="imagebtn" OnClick="informationbtn_Click" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </li>
                </ul>
            <asp:Button ID="txtFile" runat="server" Text="类别详细" Visible="false" />
            </div>
        </div>



        <hr align="left" size="3px" color="gray" width="920px" style="width: 100%;"/>
        <%--状态栏--%>
        <div id="status">
            资产管理
            <asp:Label ID="lblProErr" runat="server"></asp:Label>
            <asp:Label ID="username" runat="server"></asp:Label>
        </div>


        <nav class="menus">
            <%--侧边栏--%>
            <ul>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="MyWork.aspx" style="text-decoration:none;">我的业务</a>
                </li>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="InsertAsset.aspx" style="text-decoration:none;">计入资产</a>
                </li>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="AssetCategory.aspx">计入类别</a>

                </li>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="../MaintenanceMgm/AllMaintenance.aspx">维修申请</a>

                </li>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="../UserWork/UpdataAmount.aspx">库存管理</a>

                </li>
                <li style="float: left; list-style: none;padding:3px;">
                    <a href="../UserWork/AssetBR.aspx" >资产借还管理</a>
                </li>
            </ul>

        </nav>
        <div class="content" style="border-radius: 10px; position: absolute; top: 15%; left: 25%;">
            <%--主要内容--%>
            
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>

                    <asp:GridView ID="dgvAsset" runat="server" AutoGenerateColumns="False" Width="1000px" Height="600px" AllowPaging="True" BackColor="White" CssClass="asset-gridview">
                        <Columns>
                            <asp:TemplateField HeaderText="选择">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkChoice" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Aid" HeaderText="资产编码">
                                <HeaderStyle Width="70px" />
                            </asp:BoundField>
                            <asp:HyperLinkField DataNavigateUrlFields="Aid" DataNavigateUrlFormatString="~/UserWork/UpdateAsset.aspx?Aid={0}" DataTextField="Aname" DataTextFormatString="{0:c}" HeaderText="资产名称" />
                            <asp:TemplateField HeaderText="类别">
                                <ItemTemplate>
                                    <asp:Label ID="lblCategory" runat="server" Text='<%# GetCategoryName(Eval("Tid")) %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Aamount" HeaderText="数额" />
                            <asp:BoundField DataField="Unit" HeaderText="计量单位" />
                            <asp:BoundField DataField="Cperson" HeaderText="负责人" />
                            <asp:BoundField DataField="Telephone" HeaderText="负责人电话" />
                            <asp:BoundField DataField="Department" HeaderText="部门" />
                            <asp:BoundField DataField="DTelephone" HeaderText="部门电话" />
                            <asp:BoundField DataField="Describe" HeaderText="描述" />
                        </Columns>
                        <PagerSettings FirstPageText="首页" LastPageText="尾页" Mode="NextPreviousFirstLast" NextPageText="下一页" PreviousPageText="上一页" PreviousPageImageUrl="~/Image/33上一页、前一页.png" FirstPageImageUrl="~/Image/首页.png" LastPageImageUrl="~/Image/跳转尾页.png" NextPageImageUrl="~/Image/31下一页、后一页.png" />
                    </asp:GridView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:LinqDataSource ID="ldsAsset" runat="server" ContextTypeName="MyUAMS.DAL.DataClasses1DataContext" EntityTypeName="" TableName="Asset_Table">
            </asp:LinqDataSource>
        </div>
        <asp:Button ID="Button1" runat="server" Text="删除资产" OnClick="btnDelete_Click" CssClass="button2 button3"/>
        <asp:Button ID="ToExcel" runat="server" Text="导出excel" OnClick="ToExcel_Click" CssClass="button2 button4"/>
    </form>
    <script src="Scripts/MyWork.js"></script>
    <script>
        // 获取侧边栏和图片按钮元素
        var sidebar = document.querySelector('.menus');
        var menuToggle = document.querySelector('.menu-toggle');

        // 为图片按钮添加点击事件
        menuToggle.addEventListener('click', function () {
            // 切换侧边栏的显示和隐藏
            var sidebarStyle = sidebar.style;
            if (sidebarStyle.left === '-200px') {
                sidebarStyle.left = '0';
            } else {
                sidebarStyle.left = '-200px';
            }
        });
    </script>
</body>
</html>
